<?php

use Illuminate\Support\Facades\Route;

//use App\Http\Controllers\User;
//use App\Http\Controllers\Index;

use App\Http\Controllers\Admin\User;
use App\Http\Controllers\Admin\Index;
use App\Http\Controllers\Admin\Adminlist;
Route::group(['namespace'=>'admin'],function (){

    Route::get('/showlogin', [User::class, 'showlogin']);
    Route::post('/login', [User::class, 'login']);
    Route::get('/loginout', [Index::class, 'loginout']);
});

Route::group(['namespace'=>'admin','middleware'=>'login'],function (){
    Route::get('/index', [Index::class, 'index']);
    Route::get('/welcome', [Index::class, 'welcome']);
    Route::get('/showlist', [Adminlist::class, 'showlist']);
    Route::get('/showAdd', [Adminlist::class, 'showAdd']);
    Route::post('/add', [Adminlist::class, 'add']);
    Route::get('/del/{id}', [Adminlist::class, 'del']);
    Route::get('/restore', [Adminlist::class, 'restore']);
    Route::get('/ten/{id}', [Adminlist::class, 'ten']);
    Route::get('/foreDelete/{id}', [Adminlist::class, 'ten']);
    Route::post('/delAll', [Adminlist::class, 'delAll']);

});
